package com.ck.express.utils

import android.util.Log

// 全局日志控制对象
object LogConfig {
    var enableDebug = false
}

// Log 扩展函数
inline fun Any.debugLog(message: () -> String) {
    if (LogConfig.enableDebug) {
        Log.d(this::class.simpleName, message())
    }
}

inline fun Any.infoLog(message: () -> String) {
    Log.i(this::class.simpleName, message())
}

inline fun Any.warnLog(message: () -> String) {
    Log.w(this::class.simpleName, message())
}

inline fun Any.errorLog(message: () -> String, throwable: Throwable? = null) {
    Log.e(this::class.simpleName, message(), throwable)
}